Ext.define('App.special-weekday.viewmodel.SpecialWeekdayViewModel', {
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.SpecialWeekdayViewModel',
    requires: ['App.special-weekday.model.SpecialWeekdayModel'],
    data: {
        columns: [{
            header: 'ID',
            dataIndex: 'id',
            hidden: true
        }, {
            header: '节日类型',
            dataIndex: 'name'
        }, {
            xtype: 'ymdcolumn',
            header: '补班日期',
            dataIndex: 'dt'
        }, {
            header: '描述',
            dataIndex: 'description'
        }],
        search: {
            simpleSearch: true,
            advancedSearch: true,
            fields: [{
                "field": "name",
                "name": "节日类型",
                vtype: 's',
                opt: '=',
                datas: [['元旦', '元旦'], ['清明', '清明'], ['端午', '端午'], ['妇女', '妇女'], ['五一', '五一'], ['中秋', '中秋'], ['国庆', '国庆'], ['春节', '春节']]
            }]
        }
    },
    stores: {
        Query: {
            autoLoad: false,
            model: 'App.special-weekday.model.SpecialWeekdayModel',
            pageSize: 25,
            remoteSort: true,
            sorters: [{
                property: 'dt',
                direction: 'asc'
            },{
                property: 'name',
                direction: 'asc'
            }],
            proxy: {
                type: 'majax',
                url: 'management/special-weekday/query',
                reader: {
                    type: 'json',
                    rootProperty: 'data',
                    totalProperty: 'total'
                }
            }
        }
    }
});